import { createRouter, createWebHistory } from "vue-router";

import AboutView from "@/views/About.vue";
import StudentManagementView from "@/views/StudentManagement.vue";
import UseCounterView from "@/views/UseCounter.vue";
// import StudentInfo from "@/views/StudentInfo.vue";

const routes = [
    { path: '/about', component: AboutView },
    { path: '/students', component: StudentManagementView },
    {
        path: '/use-counter',
        component: UseCounterView
    },
    {
        path: '/students/:studentNo',
        component: () => import('@/views/StudentInfo.vue')
    },
    {
        path: '/students/search',
        component: () => import('@/views/StudentSearch.vue')
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes, // 等效：routes: routes
});

export default router;
